package com.cykj.service.Impl;

import com.cykj.dto.ResponseDto;
import com.cykj.mapper.AppointmentMapper;
import com.cykj.pojo.PsAppointmentRecord;
import com.cykj.service.AppointmentService;
import com.cykj.vo.UserAssessVo;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @BelongsProject: Psychology
 * @BelongsPackage: com.cykj.service.Impl
 * @Author: 小林
 * @CreateTime: 2025-02-07 10:28
 * @Description: 存储记录表service层
 * @Version: 1.0
 */
@Service
public class AppointmentServiceImpl implements AppointmentService {
    @Autowired
    private AppointmentMapper appointmentMapper;

    /**
     * 获取预约记录表领域表用户表信息
     * @param vo
     * @return
     */
    @Override
    public ResponseDto getAppiontmentAndtyoeAndUser(UserAssessVo vo) {
        PageHelper.startPage(vo.getPageNum(), vo.getPageSize());
        List<PsAppointmentRecord> appiontmentAndtyoeAndUser = appointmentMapper.getAppiontmentAndtyoeAndUser(vo);
        PageInfo<PsAppointmentRecord> page = new PageInfo<>(appiontmentAndtyoeAndUser);
        return page == null ? ResponseDto.error("查询失败") : ResponseDto.success(page);
    }
}

